package com.jiazhong.mingxing.boot.boot07.util;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@NoArgsConstructor
@Data
public class JsonResult<T> implements Serializable {

    private T data;
    private Boolean success;
    private String message;
    private Integer code;

    public JsonResult(T data) {
        this.data = data;
        this.success = true;
        this.code = 200;
    }

    public JsonResult(String message, Integer code) {
        this.message = message;
        this.code = code;
        this.success = false;
    }
}
